package com.foosun.sweb.util
{
	public class Utils
	{
		public function Utils()
		{
		}
		
		//去除左边空格   
		public static function leftTrim(s:String):String{       
			var i:Number=0;      
			while(s.charCodeAt(i)==32 || s.charCodeAt(i)==13 || s.charCodeAt(i)==10 || s.charCodeAt(i)==9){       
				i++;      
			}       
			return s.substring(i,s.length);      
		}    
		//去除右边空格   
		public static function rightTrim(s:String):String{       
			var i:Number=s.length-1;      
			while(s.charCodeAt(i)==32 || s.charCodeAt(i)==13 || s.charCodeAt(i)==10 ||s.charCodeAt(i)==9){       
				i--;      
			}       
			return s.substring(0,i+1);      
		}   
		//去除空格   
		public static function trim(s:String):String{   
			return leftTrim(rightTrim(s));      
		}   
		
	}
}